package sb.simple.multi_sql_source;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import sb.simple.multi_sql_source.login.service.LoginService;
import sb.simple.multi_sql_source.register.service.RegisterService;

/**
 * 多数据库源配置示例
 */
@Controller
@RequestMapping(value = "multi_sql")
public class TestController {

    @Autowired
    LoginService loginService;
    @Autowired
    RegisterService registerService;

    @ResponseBody
    @RequestMapping("login")
    public String getUsersByLogin() {
        return "login:" + loginService.getUsers().toString();
    }

    @ResponseBody
    @RequestMapping("register")
    public String getUsersByRegister() {
        return "register:" + registerService.getUsers().toString();
    }

}
